package com.woniuxy.mapper;

import com.woniuxy.entity.Follow;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FollowMapper {
    @Select("select followed_id from follow where follower_id=#{followerId}")
    List<Integer> getFollowedIdList(Integer followerId);

    @Insert("insert into follow(follower_id,followed_id) values(#{followerId},#{followedId})")
    void add(Follow follow);

    @Delete("delete from follow where follower_id=#{followerId} and followed_id=#{followedId}")
    void cancel(Follow follow);
}
